<template>
	<view class="count-down-wrap">
		<u-count-down :time="time" format="DD:HH:mm:ss" autoStart millisecond @change="onChange">
			<view class="time">
				<text class="time__item" v-if="timeData.days > 0">{{ timeData.days }}:</text>
				<text class="time__item"
					v-if="timeData.hours > 0">{{ timeData.hours>=10?timeData.hours:'0'+timeData.hours }}:</text>
				<text class="time__item">{{ timeData.minutes>=10?timeData.minutes:'0'+timeData.minutes   }}:</text>
				<text class="time__item">{{ timeData.seconds>=10?timeData.seconds:'0'+timeData.seconds  }}</text>
			</view>
		</u-count-down>
	</view>
</template>
<script>
	export default {
		props: {
			time: {
				type: [String, Number],
				default: 0
			}
		},
		data() {
			return {
				timeData: {},
			}
		},
		methods: {
			onChange(e) {
				this.timeData = e
			}
		}
	}
</script>

<style lang="scss" scoped>
	.w-fill-block-wrap {}
</style>